//---------------------------------------------------------------------------

#ifndef utilizationH
#define utilizationH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "FIBDataSet.hpp"
#include "pFIBDataSet.hpp"
#include <DB.hpp>
#include <DBCtrls.hpp>
#include <DBGrids.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include <ComCtrls.hpp>
#include <Menus.hpp>
#include <Mask.hpp>
#include "FIBQuery.hpp"
#include "pFIBQuery.hpp"
#include "pFIBStoredProc.hpp"
#include "frxClass.hpp"
#include "frxFIBComponents.hpp"
#include "frxDBSet.hpp"
#include "frxExportHTML.hpp"
#include "frxExportXLS.hpp"
#include "frxExportPDF.hpp"
#include "SIBEABase.hpp"
#include "SIBFIBEA.hpp"
#include "frxDesgn.hpp"
#include <NMFtp.hpp>
#include <Psock.hpp>
//---------------------------------------------------------------------------
class TFormUtl : public TForm
{
__published:	// IDE-managed Components
        TLabel *Label2;
        TpFIBDataSet *pFIBDataSetBus;
        TFIBBCDField *pFIBDataSetBusID;
        TFIBBCDField *pFIBDataSetBusID_MODELS;
        TFIBStringField *pFIBDataSetBusNUM_BODY;
        TFIBStringField *pFIBDataSetBusVIN;
        TFIBStringField *pFIBDataSetBusNUM_VR;
        TFIBDateField *pFIBDataSetBusDATE_VR;
        TFIBStringField *pFIBDataSetBusNUM_TS;
        TFIBDateField *pFIBDataSetBusDATE_TS;
        TpFIBDataSet *pFIBDataSetModels;
        TStringField *pFIBDataSetBusNameModels;
        TDBGrid *DBGrid1;
        TDataSource *DSBus;
        TPopupMenu *PopupMenuDoc;
        TMenuItem *N1;
        TMenuItem *N2;
        TMenuItem *N3;
        TMenuItem *N4;
        TMenuItem *N5;
        TMenuItem *N6;
        TMenuItem *N7;
        TFIBBCDField *pFIBDataSetBusID_STATE;
        TFIBStringField *pFIBDataSetBusNAME_STATE;
        TpFIBDataSet *ds_doc;
        TLabel *Label1;
        TDBGrid *DBGrid2;
        TDataSource *DataSourceDoc;
        TFIBBCDField *ds_docID;
        TFIBBCDField *ds_docID_BUS;
        TFIBDateField *ds_docDATE_DOC;
        TFIBStringField *ds_docNUM_DOC;
        TFIBBCDField *ds_docID_STATE;
        TFIBStringField *ds_docNAME_STATE;
        TFIBBCDField *ds_docID_ROUTE;
        TFIBStringField *ds_docNAME_ROUTE;
        TFIBDateTimeField *ds_docDATE_START_DOC;
        TFIBDateTimeField *ds_docDATE_END_DOC;
        TFIBBCDField *ds_docID_PERSONAL_DRIVER;
        TFIBStringField *ds_docFIO;
        TButton *Button1;
        TButton *Button2;
        TpFIBStoredProc *proc_delete;
        TfrxReport *frxReportHtml;
        TfrxFIBComponents *frxFIBComponents1;
        TButton *ButtonReport;
        TfrxHTMLExport *frxHTMLExport;
        TfrxXLSExport *frxXLSExport;
    TFIBBCDField *ds_docPARENT_ID_HEAD;
    TFIBDateTimeField *ds_docDATE_SAVE_DOC;
    TFIBBCDField *pFIBDataSetBusID_HEAD_STATE;
    TfrxPDFExport *frxPDFExport;
        TCheckBox *CheckBoxReport;
        TSIBfibEventAlerter *event_send;
    TStatusBar *StatusBar;
        TMenuItem *N8;
        TMenuItem *N9;
    TNMFTP *ftp_tms;
    TMenuItem *N10;
    TMenuItem *N11;
        TMenuItem *N12;
    TFIBDateTimeField *pFIBDataSetBusDATE_DOC_INSURANCE;
    TFIBDateTimeField *pFIBDataSetBusDATE_DOC_SERVICE;
    TFIBStringField *pFIBDataSetBusNUM_DOC_INSURANCE;
    TFIBStringField *pFIBDataSetBusNUM_DOC_SERVICE;
    TLabel *Label3;
        void __fastcall N1Click(TObject *Sender);
        void __fastcall FormHide(TObject *Sender);
        void __fastcall N2Click(TObject *Sender);
        void __fastcall FormShow(TObject *Sender);
        void __fastcall DBGrid2DblClick(TObject *Sender);
        void __fastcall N3Click(TObject *Sender);
        void __fastcall N4Click(TObject *Sender);
        void __fastcall N7Click(TObject *Sender);
        void __fastcall N6Click(TObject *Sender);
        void __fastcall Button1Click(TObject *Sender);
        void __fastcall Button2Click(TObject *Sender);
        void __fastcall ButtonReportClick(TObject *Sender);
    void __fastcall DBGrid2KeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);

    void __fastcall DBGrid2DrawColumnCell(TObject *Sender,
          const TRect &Rect, int DataCol, TColumn *Column,
          TGridDrawState State);
        void __fastcall event_sendEventAlert(TObject *Sender,
          AnsiString EventName, int EventCount);
        void __fastcall N5Click(TObject *Sender);
        void __fastcall N9Click(TObject *Sender);

    void __fastcall ftp_tmsConnectionFailed(TObject *Sender);
    void __fastcall ftp_tmsConnect(TObject *Sender);
    void __fastcall ftp_tmsListItem(AnsiString Listing);
    void __fastcall ftp_tmsSuccess(TCmdType Trans_Type);
    void __fastcall N11Click(TObject *Sender);
        void __fastcall N12Click(TObject *Sender);
private:	// User declarations
public:		// User declarations
        unsigned long id_bus;
        unsigned long id_head;
        void __fastcall CreateOrEditDoc(unsigned int id_state);
        void __fastcall RunReport2GoogleDrive();
        void __fastcall DeleteDoc();
        __fastcall TFormUtl(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFormUtl *FormUtl;
//---------------------------------------------------------------------------
#endif
